package com.coffee.admin.api.merchant.service;

import com.coffee.admin.api.login.request.ForgetByPasswordReq;
import com.coffee.admin.api.login.request.ForgetBySmsReq;
import com.coffee.admin.api.login.request.LoginByPasswordRequert;
import com.coffee.admin.api.login.request.LoginBySmsRequert;
import com.coffee.admin.api.merchant.query.MerchantQuery;
import com.coffee.admin.api.merchant.rep.MerchantDetailRep;
import com.coffee.admin.api.merchant.rep.MerchantListRep;
import com.coffee.admin.api.merchant.req.*;
import com.coffee.admin.api.merchant.result.IntegralResult;
import com.coffee.admin.api.merchant.result.MerchantResult;
import com.coffee.core.entity.Page;
import com.coffee.core.entity.PagerInfo;
import com.coffee.core.exception.BusinessException;
import com.coffee.order.api.inquire.result.WeiXinPushIntegralResult;

import java.util.List;
import java.util.Map;
import java.util.Set;


public interface MerchantService {

    Page<MerchantListRep> getPager(MerchantListReq req, PagerInfo pr);

    Page<MerchantListRep> getSupplierAndMerchantPager(MerchantListReq req, PagerInfo pr);

    Integer count(MerchantQuery param);

    MerchantResult getDetail(Integer id);

    IntegralResult getIntegralResult(Integer id);

    MerchantResult getDetailByOpenId(String openId);

    MerchantResult getDetailByMobile(String mobile) throws BusinessException;

    /**
     * 平台查看商户详情
     *
     * @param id
     * @return
     */
    MerchantDetailRep platformGetDetail(Integer id);

    List<MerchantResult> getList(MerchantQuery param, PagerInfo pr);

    List<MerchantResult> getList(MerchantQuery param);

    List<MerchantResult> getList();

    void delete(Integer id);

    void add(MerchantResult result) throws BusinessException;

    void update(MerchantResult result) throws BusinessException;

    void updateMobile(MerchantUpdateMobileReq req) throws BusinessException;

    void updatePassword(MerchantUpdatePasswordReq req) throws BusinessException;

    void updateBuyPermission(MerchantUpdateBuyPermissionReq req) throws BusinessException;

    WeiXinPushIntegralResult updateIntegral(MerchantUpdateIntegralReq req) throws BusinessException;

    void updateIsEnable(MerchantUpdateIsEnableReq req) throws BusinessException;

    Map<Integer, MerchantResult> getItemMap(Set<Integer> idSet);

    Map<Integer, MerchantResult> getItemMap();

    String register(RegisterReq req) throws BusinessException;

    String getByMobile(String mobile, String code) throws BusinessException;

    String weixingRegister(RegisterReq req) throws BusinessException;

    String passwordLogin(LoginByPasswordRequert req) throws BusinessException;

    String smsLogin(LoginBySmsRequert req) throws BusinessException;

    String forgetBySmsReq(ForgetBySmsReq req) throws BusinessException;

    String forgetByPasswordReq(ForgetByPasswordReq req) throws BusinessException;

    void updateMerchantCity() throws Exception;

    void updateBalance(MerchantUpdateBalanceReq req) throws BusinessException;

    void addBalance(MerchantUpdateBalanceReq req) throws BusinessException;
}